﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Engine.Helpers {

    public class Vector3 {

        public var x:Number;
        public var y:Number;
        public var z:Number;

        public function Vector3(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
            this.x = _arg1;
            this.y = _arg2;
            this.z = _arg3;
        }
        public static function computeSquareDistance(_arg1:Vector3, _arg2:Vector3):Number{
            var _local3:Number = (_arg1.x - _arg2.x);
            var _local4:Number = (_arg1.y - _arg2.y);
            var _local5:Number = (_arg1.z - _arg2.z);
            return ((((_local3 * _local3) + (_local4 * _local4)) + (_local5 * _local5)));
        }
        public static function lerp(_arg1:Vector3, _arg2:Vector3, _arg3:Number):Vector3{
            var _local4:Vector3 = new (Vector3)();
            var _local5:Number = (1 - _arg3);
            _local4.x = ((_arg1.x * _local5) + (_arg2.x * _arg3));
            _local4.y = ((_arg1.y * _local5) + (_arg2.y * _arg3));
            _local4.z = ((_arg1.z * _local5) + (_arg2.z * _arg3));
            return (_local4);
        }

        public function clone():Vector3{
            return (new Vector3(this.x, this.y, this.z));
        }
        public function set(_arg1:Vector3):void{
            this.x = _arg1.x;
            this.y = _arg1.y;
            this.z = _arg1.z;
        }
        public function add(_arg1:Vector3):Vector3{
            var _local2:Vector3 = new Vector3((this.x + _arg1.x), (this.y + _arg1.y), (this.z + _arg1.z));
            return (_local2);
        }
        public function subtract(_arg1:Vector3):Vector3{
            var _local2:Vector3 = new Vector3((this.x - _arg1.x), (this.y - _arg1.y), (this.z - _arg1.z));
            return (_local2);
        }
        public function scale(_arg1:Number):Vector3{
            var _local2:Vector3 = new Vector3((this.x * _arg1), (this.y * _arg1), (this.z * _arg1));
            return (_local2);
        }
        public function equals(_arg1:Vector3):Boolean{
            return ((((((this.x == _arg1.x)) && ((this.y == _arg1.y)))) && ((this.z == _arg1.z))));
        }
        public function toString():String{
            return (String((((((("(x: " + this.x) + ", y: ") + this.y) + ", z: ") + this.z) + ")")));
        }
        public function toVector2():Vector2{
            return (new Vector2(this.x, this.y));
        }
        public function toIntVector2():IntVector2{
            return (new IntVector2(this.x, this.y));
        }
        public function isAxisAligned():Boolean{
            return ((((((((this.x == 0)) && ((this.y == 0)))) || ((((this.x == 0)) && ((this.z == 0)))))) || ((((this.y == 0)) && ((this.z == 0))))));
        }
        public function dot(_arg1:Vector3):Number{
            return ((((this.x * _arg1.x) + (this.y * _arg1.y)) + (this.z * _arg1.z)));
        }
        public function cross(_arg1:Vector3):Vector3{
            return (new Vector3(((this.y * _arg1.z) - (this.z * _arg1.y)), ((this.z * _arg1.x) - (this.x * _arg1.z)), ((this.x * _arg1.y) - (this.y * _arg1.x))));
        }
        public function length():Number{
            return (Math.sqrt(this.dot(this)));
        }
        public function normalize():Vector3{
            var _local1:Number = this.length();
            return (new Vector3((this.x / _local1), (this.y / _local1), (this.z / _local1)));
        }
        public function floor():Vector3{
            return (new Vector3(Math.floor(this.x), Math.floor(this.y), Math.floor(this.z)));
        }
        public function ceil():Vector3{
            return (new Vector3(Math.ceil(this.x), Math.ceil(this.y), Math.ceil(this.z)));
        }

    }
}//package Engine.Helpers 
